package com.hoshiibuy.global.entity.param;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.global.entity.SysLabels;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * <p>
 * 查询标签全局表参数
 * </p>
 *
 * @author campchen
 * @since 2019-04-27
 */
@Data
@ApiModel(value = "查询标签全局表", description = "查询标签全局表")
public class SysLabelsQueryParam extends CommonParam {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    private Long id;

    /**
     * 平台ID
     */
    @ApiModelProperty(value = "平台ID")
    private Long platid;

    /**
     * 属性名称
     */
    @ApiModelProperty(value = "属性名称")
    private String name;

    /**
     * 1-管理机构标签 2-平台标签 3-会员标签 4-营销标签
     */
    @ApiModelProperty(value = "1-管理机构标签 2-平台标签 3-会员标签 4-营销标签",example = "1")
    private Integer type;

    /**
     * 标志
     */
    @ApiModelProperty(value = "标志")
    private String tag;

    /**
     * 是否可用0-不可用 1-可用
     */
    @ApiModelProperty(value = "是否可用0-不可用 1-可用 系统自动传递1", required = true,example = "1")
    private Integer enabled;

    public QueryWrapper<SysLabels> getQueryWrapper() {
        QueryWrapper<SysLabels> queryWrapper = new QueryWrapper<SysLabels>();
        queryWrapper.eq(this.id != null, "id", this.id);
        queryWrapper.eq(this.platid != null, "platid", this.platid);
        queryWrapper.eq(StringUtils.isNotBlank(this.name), "name", this.name);
        queryWrapper.eq(this.type != null, "type", this.type);
        queryWrapper.eq(StringUtils.isNotBlank(this.tag), "tag", this.tag);
        queryWrapper.eq(this.enabled != null, "enabled", this.enabled);
        return queryWrapper;
    }
}
